from llm import NovelLLM
from util import writeFile
from .base import BaseNode

class Step9Node(BaseNode):
    def run(self, state):
        prompt = "第九步：开始写作\n当前场景清单：{scenes}\n请将<场景清单>解析为json数据".format(scenes=state['step8_output'])
        result = NovelLLM().call_llm(prompt, caller_name="Step9")
        state['step9_output'] = result
        writeFile("output/step9.txt", result)
        print(f"Step9 完成小说创作")
        return state